package ndk.caro.activities;

import ndk.caro.activities.R;
import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.view.Menu;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.Animation.AnimationListener;
import android.widget.ImageView;

public class myMainActivity extends Activity implements AnimationListener {
	private Animation logo_anim;
	private ImageView logo;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.logo_layout);
		
		logo = (ImageView) findViewById(R.id.logo_start);
		logo_anim = AnimationUtils.loadAnimation(this, R.anim.logo_alpha);
		logo.startAnimation(logo_anim);
		logo_anim.setAnimationListener(this);
		
	}
	public void DisplayAuthor() {
		 new AlertDialog.Builder(this)
			.setTitle(R.string.about_title)
			.setMessage(R.string.about_text)
			.setIcon(R.drawable.icon_app)
			.show();
	}
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	@Override
	public void onAnimationEnd(Animation animation) {
		if (animation.equals(logo_anim))
		setContentView(R.layout.menu_layout);
		
	}
	@Override
	public void onAnimationRepeat(Animation animation) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void onAnimationStart(Animation animation) {
		// TODO Auto-generated method stub
		
	}

}
